﻿

#region Usings...
using System;
using System.IO;
using TSW.Core.Config;
#endregion

namespace TSW.Core
{
    /// <summary>
    /// Test? this is for Console Text Translation...
    /// </summary>
    public class ConsoleText
    {
        private readonly string Locale = ConfigReadWrite.Instance.CurrentConfig.Locale;

        /// <summary>
        /// Please do not include language_  in the file name example:  main.txt"
        /// </summary>
        /// <param name="FileName"></param>
        public void TextRead(string FileName)
        {
            try
            {
                StreamReader reader =
                    File.OpenText(Path.Combine(Path.Combine("locale", Locale), Locale + "_" + FileName));
                string console_input = null;
                while ((console_input = reader.ReadLine()) != null)
                {
                    Console.WriteLine(console_input);
                }
                reader.Close();
            }
            catch (FileNotFoundException fnfex)
            {
                Console.WriteLine(fnfex.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
    }
}